<?php echo $this->Html->script(array("jquery.easing.min.1.3","jquery.jcontent.0.8.min"));?>
<?php echo $this->Html->css(array("demo"));?>
<script type="text/javascript" language="javascript">
    $("document").ready(function(){
        $("div#demo5").jContent({orientation: 'vertical',
                                 easing: "easeOutCirc",
                                 duration: 500,
                                 auto: true,
								 pause_on_hover: true,
                                 direction: 'next',
                                 pause: 2500});
    });
</script>
<div id="sidebar-primary">
    <ul class="widget-container">
        <li class="social-profiles-widget">
             <h3 class="widgettitle">
			 <?php echo $this->Html->link('Thư viện ảnh',array('controller'=>'galleries'));?>
             </h3>
             <div id="demo5" class="demo5">
             <div class="slides">
			 <?php  foreach($gallery as $gallery){?>
		        <div align="justify">
 		            <div class="txt" align="center">
						<?php if(!empty($gallery['Img'])){
		                    echo $this->Html->link($this->Html->image('../files/uploads/gallery/'.$gallery['Img'][0]['url'],array('alt'=>$gallery['Gallery']['name'],'title'=>$gallery['Gallery']['name'],'width'=>280,'height'=>210)),
		                        array('controller'=>'galleries','action'=>'view',$this->Link->seo($gallery['Gallery']['id'],$gallery['Gallery']['name'])),array('escape'=>false)
		                        );
							}else{
		                    	echo $this->Html->link($this->Html->image('no-image.jpg',array('alt'=>$gallery['Gallery']['name'],'title'=>$gallery['Gallery']['name'],'width'=>280,'height'=>210)),
		                        array('controller'=>'galleries','action'=>'view',$this->Link->seo($gallery['Gallery']['id'],$gallery['Gallery']['name'])),array('escape'=>false)
		                        );
		                  }
		                ?>
					</div>
                    <div class='title'>&nbsp;
		            	<a href="<?php echo $this->webroot;?>galleries/view/<?php echo $this->Link->seo($gallery['Gallery']['id'],$gallery['Gallery']['name']);?>" title="<?php echo $gallery['Gallery']['name'];?>" rel="bookmark"><?php echo $this->Text->truncate($gallery['Gallery']['name'],32,array('exact'=>true,'html'=>true)) ?></a>
		            </div>
		        </div>
			 <?php }?>
			 </div>
			 </div>
			 <div class="clear"></div>
		</li>
        <div style="height:8px;"></div>
		 <li class="social-profiles-widget">
             <h3 class="widgettitle">Tin nổi bật</h3>
			 <?php foreach($hotnews as $k=> $hot){?>
					<div class="hot">
						<a style="font-family:Georgia;" href="<?php echo $this->webroot;?>news/chitiet/<?php echo $this->Link->seo($hot['News']['id'],$hot['News']['title']);?>" title="<?php echo $hot['News']['title'];?>" rel="bookmark"><h2><?php
						if($k<9){echo '0';}
						echo ($k+1).'. '.$this->Text->truncate($hot['News']['title'],100,array('html'=>true,'ending'=>'...','exact'=>false));?></h2></a>
					</div>
					<div class="clear"></div>
			 <?php }?>
		</li>
        <div style="height:8px;"></div>
		 <li class="social-profiles-widget">
             <h3 class="widgettitle">Đối tác</h3>
             <div align="center">
			 <?php foreach($banner_r as $bn){?>
						<?php if(is_file('files/uploads/banners/'.$bn['Banner']['image'])){?>
							<a href="<?php echo $bn['Banner']['link'];?>" target='_blank' rel="bookmark"><img  width="280" class='featured_image banners' src="<?php echo $this->webroot;?>files/uploads/banners/<?php echo $bn['Banner']['image'];?>"></a>
						<?php }else{ ?>
							<a href="<?php echo $bn['Banner']['link'];?>" target='_blank' target='_blank' title="<?php echo $bn['Banner']['name'];?>" rel="bookmark"><img class="featured_image" width="280" src="<?php echo $this->webroot;?>img/no-image.jpg"></a>
						<?php }?>
					<div class="clear"></div>
			 <?php }?>
             </div>
		</li>
        <li class="social-profiles-widget">
             <h3 class="widgettitle">Số lượt truy cập</h3>
               <div align='center'><BR><a href='http://www.hit-counts.com'><img src='http://www.hit-counts.com/counter.php?t=MTIxMzg0Mw==' border='0' alt='Free Hit Counter'></a><BR><BR></div>
		</li>
	</ul>
</div>
